package com.ftg.learn.framework.sm.mapper;

import com.ftg.learn.framework.sm.entity.TeacherEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 布衣
 */
@Mapper
public interface TeacherMapper {

    @Select("select * from teacher")
    List<TeacherEntity> list();

    /**
     * 查找 帐号是否存在
     * @param account
     */
    @Select("select count(tno) from teacher where tno = #{account}")
    int selectOneByAccount(@Param("account") String account);

    @Select("select tno from teacher where tno = #{account} and tname = #{tname}")
    String selectOneByAccountAndPassword(String account);
}
